﻿#region Using declarations
using System;
using System.ComponentModel;
using System.Drawing;
using System.Globalization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Strategy;
#endregion

// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
    /// <summary>
    /// This file holds user defined strategy method.
    /// </summary>
    partial class Strategy
    {
        ///The compression setting of the price data for the applied analysis technique.
        ///Returns: 0 forTick, 1 for Intraday, 2 for Daily, 3 for Weekly, 4 for Monthly, 5 for Point and Figure.
        ///Intraday and Point and Figure not available in NinjaTrader 6

        public int DataCompression()
        {
            switch (BarsArray[BarsInProgress].Period.Id)
            {
                case PeriodType.Tick:
                    return 0;
                case PeriodType.Minute:
                    return 1;
                case PeriodType.Day:
                    return 2;
                case PeriodType.Week:
                    return 3;
                case PeriodType.Month:
                    return 4;
                default:
                    return 999;
            }
        }

    }
}
